<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<html>
<head>
    <link href="css/style.css" rel="stylesheet" type="text/css"/>
    <script src="js/myJs.js"></script>

    <script>
        //验证提交表单
        function validatePost() {
            if (validateFiled($("userNumber"), "用户名") == true &&
                validateFiled($("name"), "姓名") == true &&
                validateFiled($("passWord"), "密码") == true &&
                validateFiled($("phone"), "电话号码") == true &&
                validateFiled($("identification"), "身份证号") == true) {
                $("registerForm").submit();
            }
        }
    </script>
</head>
<body id="register">
<form id="registerForm" action="UserServlet?action=userSelfInfo" method="post">
    <h3>高校疫情防控管理系统 个人信息管理</h3>
    <label for="userNumber">
        <span>学号/工号：</span>
        <input id="userNumber" name="userNumber" type="text" value="${loginUserInfo.userNumber}" readonly/>
    </label>
    <label for="name"><span>姓名：</span><input id="name" name="name" type="text" value="${loginUserInfo.name}"/></label>
    <label for="passWord"><span>密码：</span><input id="passWord" name="passWord" type="password"/></label>
    <label for="sex">
        <span>性别：</span>
        <select id="sex" name="sex">
            <c:if test="${loginUser.sex}=='男'"></c:if>
            <option value="男" selected="selected">男</option>
            <option value="女">女</option>
        </select>
    </label>
    <label for="phone"><span>电话号码：</span><input id="phone" name="phone" type="text"
                                                value="${loginUserInfo.phone}"/></label>
    <label for="identification"><span>身份证号：</span><input id="identification" name="identification" type="text"
                                                         value="${loginUserInfo.identification}"/></label>
    <label for="faculty">
        <span>所属学院：</span>
        <select id="faculty" name="faculty">
            <c:forEach items="${faculties}" var="faculty">
                <option value="${faculty.facultyId}">${faculty.facultyName}</option>
            </c:forEach>
        </select>
    </label>
    <label for="userRole">
        <span>身份：</span>
        <select id="userRole" name="userRole">
            <option value="学生" selected="selected">学生</option>
            <option value="教职工">教职工</option>
        </select>
    </label>
    <div id="button">
        <input id="registerButton" name="registerButton" type="button" class="bt" value="修改" onclick="validatePost()">
    </div>
</form>

</body>
</html>

